//
//  WSSettingRequest.m
//  BaseProject
//
//  Created by karong on 2023/8/7.
//

#import "WSSettingRequest.h"

@implementation WSSettingRequest

+ (void)bindGoogleWithSuccess:(charonTV_EmptyBlock)success failed:(Failure)failed {
    NSString * url = API_CHARONTV_USER_BIND_GOOGLE;
    NSDictionary * parameters = @{@"firebase_token":WSEmptyStr(appUserCenter.qtoken),
                                  @"token":WSEmptyStr(appUserCenter.token),
    };
    [self postWithURLString:url parameters:parameters success:^(NSDictionary * _Nonnull responseDict) {
        [appUserCenter getUserInfocharonTV_Request];
        success();
    } failure:failed];
}

+ (void)unbindGoogleWithType:(NSString *)type success:(charonTV_EmptyBlock)success failed:(Failure)failed {
    NSString * url = API_CHARONTV_USER_UNBIND_GOOGLE;
    NSDictionary * parameters = @{@"type":WSEmptyStr(type),
                                  @"account":WSEmptyStr(appUserCenter.google_account),
    };
    [self postWithURLString:url parameters:parameters success:^(NSDictionary * _Nonnull responseDict) {
        [appUserCenter getUserInfocharonTV_Request];
        success();
    } failure:failed];
}

+ (void)delUserWithSuccess:(charonTV_EmptyBlock)success failed:(Failure)failed {
    NSString * url = API_CHARONTV_USER_DEL;
    NSDictionary * parameters = @{};
    [self postWithURLString:url parameters:parameters success:^(NSDictionary * _Nonnull responseDict) {
        [appUserCenter logOut];
        success();
    } failure:failed];
}
@end
